import request from '@/utils/request'
const url = '/api/back/offline/clerk'
export function getSalesManList(page) {
  return request(
    {
      url,
      method: 'get',
      params: { type: 'lists', page, per_page: 12 }
    }
  )
}
export function addOrEditSalesMan({ username, nickname, remark, id }) {
  return request({
    url,
    method: 'post',
    data: { username, nickname, remark, id },
    params: { type: 'add' }
  })
}
export function freezeSalesMan(id, is_freeze) {
  return request({
    url,
    method: 'post',
    data: { id, is_freeze },
    params: { type: 'freeze' }
  })
}
export function getSearchList(page, condition) {
  return request({
    url,
    method: 'get',
    params: { type: 'lists', page, condition, per_page: 9 }
  })
}
// 负责店铺
export function getShopList({ id, page, condition }) {
  return request({
    url: '/api/back/offline/clerk',
    method: 'get',
    params: { type: 'shop', id, page, condition }
  })
}
// 打卡记录
export function getpunchRecordList({ shop_id, page, start_time, end_time }) {
  return request({
    url: '/api/back/offline/clerk',
    method: 'get',
    params: { type: 'siginin', shop_id, page, start_time, end_time, per_page: 5 }
  })
}
// 负责的商品
export function getSalesmanGoodsList({ id, page, condition }) {
  return request({
    url: '/api/back/offline/clerk',
    method: 'get',
    params: { type: 'commodity', id, page, condition }
  })
}
